$(document).ready(function(){
	var RECORD_PER_PAGE = 10;
	var RECORD_COUNT = 23;
	var PAGE_COUNT = RECORD_COUNT % RECORD_PER_PAGE != 0 ? 
			(RECORD_COUNT / RECORD_PER_PAGE) + 1 : 
				(RECORD_COUNT / RECORD_PER_PAGE);
	
	function initPagination() {
		$("#pagination").twbsPagination({
	        totalPages: PAGE_COUNT,
	        first: "<<",
	        prev: "<",
	        next: ">",
	        last: ">>",
	        paginationClass: "pagination pagination-sm",
	        onPageClick: function (event, page) {
	        	showHideRows(page - 1);
	        }
	    });
	}
	
	function showHideRows(index) {
		$("#table tr").hide().slice(index * RECORD_PER_PAGE, index * RECORD_PER_PAGE + RECORD_PER_PAGE).show();
	}
	
	showHideRows(0);
	initPagination();
});